<template>
  <div>
    <nav-bar :userInfo="userInfo"></nav-bar>
    <user-detail :userInfo="userInfo"></user-detail>
    <user-tabs></user-tabs>
  </div>
</template>

<script>
import NavBar from '@/components/common/NavBar'
import UserDetail from '@/components/user/UserDetail'
import UserTabs from '@/components/user/UserTabs'

export default {
  data() {
    return {
      userInfo: {},
    }
  },
  components: {
    NavBar,
    UserDetail,
    UserTabs,
  },
  created() {
    this.getUserInfo()
  },
  methods: {
    async getUserInfo() {
      const id = window.sessionStorage.getItem('id')
      const res = await this.$axios.get('/user/' + id)
      // console.log(res)
      this.userInfo = res.data[0]
    },
  },
}
</script>

<style lang="less" scoped></style>
